﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EventManager.Model.Entites;

namespace EventManager.Model.Mappings
{
    public class EventsMappings : EntityTypeConfiguration<Events>
    {
        public EventsMappings()
        {
            this.HasKey(n => n.Id);
            this.Property(n => n.Name);
            this.Property(n => n.Description);
            this.Property(n => n.StartDate);
            this.Property(n => n.EndDate);
            this.HasMany(n => n.Categories).WithMany(n=>n.Events);
            this.ToTable("Events");
        }
    }
}
